<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>150)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textField($model,'description',array('size'=>60,'maxlength'=>500)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'unit_price'); ?>
		<?php echo $form->textField($model,'unit_price',array('size'=>9,'maxlength'=>9)); ?>
		<?php echo $form->error($model,'unit_price'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'units_in_stock'); ?>
		<?php echo $form->textField($model,'units_in_stock'); ?>
		<?php echo $form->error($model,'units_in_stock'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'units_reserved'); ?>
		<?php echo $form->textField($model,'units_reserved'); ?>
		<?php echo $form->error($model,'units_reserved'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'product_category'); ?>
		<?php echo $form->dropDownList($model, 'product_category', CHtml::listData(
		ProductCategory::model()->findAll(), 'id', 'name'), array('prompt' => 'Select a product category')); ?>
		<?php echo $form->error($model,'product_category'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'supplier'); ?>
		<?php echo $form->dropDownList($model, 'supplier', CHtml::listData(
		Supplier::model()->findAll(), 'id', 'name'), array('prompt' => 'Select a supplier')); ?>
		<?php echo $form->error($model,'supplier'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->